1. Field of the Invention
The present invention relates to an imaging apparatus, and an image processing method and a program for the imaging apparatus.
2. Description of the Related Art
With advancement of digital cameras and cost reduction of storage type memories, studies have been made on applications in which digital cameras are not only used to shoot scenes and persons, but also shoot documents, such as papers and name cards, or what is written on a blackboard or so in a meeting, and digitally save those images in a personal computer or so for management.
In shooting a document or a blackboard, it is desirable to image a subject to be shot (hereinafter referred to as “shooting target”) from the front and perpendicularly. In shooting a blackboard, it may be difficult to image the blackboard from the front depending on the position of the photographer. Even if one can photograph a blackboard, there may be a case where it is preferable to avoid shooting from the front because of reflection of light. When a shooting target such as a document is shot obliquely, characters or the like are distorted obliquely or in a trapezoidal shape. Of course, those characters may be readable. Even if characters are readable, it is weary to actually read them. Because of image distortion, it is difficult to reuse those images.
There are several solutions proposed to overcome this shortcoming.
The first one is a system corrects a distorted image by using two images having a parallax (see Unexamined Japanese Patent Application KOKAI Publication No. 2001-134751, for example).
The second solution is a system which places an input image in a known fixed shape assumed, checks how the fixed shape is distorted to find transformation parameters to restore the shape to an original shape on a plane, and corrects distortion of the input image caused by tilting of a camera (see Unexamined Japanese Patent Application KOKAI Publication No. H3-94383, for example).
The third solution is a system which applies orthogonal grating to the surface of a subject to be photographed, images the subject, acquires the spatial coordinates of individual lattice points in the picked-up image, and projects the image after orthogonal transformation to a coordinate system provided on the shooting surface, thereby correcting image distortion (see Unexamined Japanese Patent Application KOKAI Publication No.
H5-101221, for example).
The fourth solution is a system which is provided with an angle setting unit which inputs an angle of inclination defined by the shooting surface of a camera and the surface of a subject, and a range finding unit which measures the distance to the subject, and images the subject surface in a state corresponding to the angle of inclination input using the angle setting unit, thereby correcting an image picked up in such a way as to match with the image of the subject as seen from the front, based on the input angle of inclination and the distance to the subject surface (see Unexamined Japanese Patent Application KOKAI Publication No. H9-289600, for example).
The fifth solution is a system which corrects distortion of an image caused by tilting of a camera based on information on the direction of the camera fixed to the rotational axis in such a way that a geometrical shape of a shooting target is reproduced correctly (see Unexamined Japanese Patent Application KOKAI Publication No. H 11-98485, for example).
The sixth solution is a system which generates four (upper right, upper left, lower right and lower left) partial images of an input image, forms a trapezium based on the inclinations of the partial images, performs tilting and rotating transformation in such a way that two opposite horizontal sides of the trapezium become parallel to each other to thereby acquire a horizontal tilt angle α, and then acquires an angle defined between a straight line which crosses the two parallel sides and the vertical direction as a skew rotational angle β.
A vertical tilt angle γ is obtained by performing tilting and rotating transformation in the vertical direction in such a way that the remaining two opposite sides of the trapezium become parallel to each other. Then, geometrical transformation is performed on the input image by using the horizontal tilt angle α, the skew rotational angle β and the vertical tilt angle β, thereby correcting the distorted image (see Unexamined Japanese Patent Application KOKAI Publication No. 2000-341501, for example).
Preparation of two images having a parallax as done in the system described in Unexamined Japanese Patent Application KOKAI Publication No. 2001-134751 is very troublesome because pictures should be taken from two locations with a camera comprising a single lens.
As the system described in Unexamined Japanese Patent Application KOKAI Publication No. H3-94383 needs to place a shooting target in a fixed figure of a known shape, it requires a troublesome work to photograph, for example, the surface of a sheet as the shooting target.
As the system described in Unexamined Japanese Patent Application KOKAI Publication No. H5-101221 requires a work of overlaying the orthogonal grating onto the subject surface and manually inputting two-dimensional coordinates of individual lattice points, thus making it difficult to photograph the subject surface in a simple operation.
In the system described in Unexamined Japanese Patent Application KOKAI Publication No. H9-289600, it is very difficult to manually and accurately input the angle of inclination defmed between the shooting surface and the subject surface by manipulating the angle setting unit. This makes it difficult to correct tilting-originated distortion of an image with a high accuracy.
In the system described in Unexamined Japanese Patent Application KOKAI Publication No. H11-98485, the distance and the angle of inclination between the surface of the original and the shooting surface are determined by the mechanical structure and layout of the camera and the camera should be fixed at a given height and set in such a way as to be rotatable about the rotational axis. This inevitably enlarges the system size and increases the manufacturing cost.
As the system described in Unexamined Japanese Patent Application KOKAI Publication No. 2000-341501 should perform multiple rotational transformations, increasing the number of arithmetic operations which requires an expensive computing device. In addition, the system takes a longer processing time.
The present invention has been made to overcome the conventional problems, and aims at providing an imaging apparatus capable of easily correcting the image of a shooting target, and an image processing method and a program for the imaging apparatus.